package de.baumann.browser.activitys.oc

import android.content.Context
import android.content.Intent
import de.baumann.browser.R
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.IBaseView
import de.baumann.browser.utils.StringUtil
import kotlinx.android.synthetic.main.activity_oc_private_key.*
import kotlinx.android.synthetic.main.include_tool_bar.*

class OcPrivateKeyActivity : BaseOdinActivity<IBaseView, BasePresenter<IBaseView>>() {

    companion object {
        fun startOcPrivateKeyActivity(context: Context, key:String) {
            context.startActivity(Intent(context, OcPrivateKeyActivity::class.java).apply {
                putExtra("key", key)
            })
        }
    }

    override fun getLayout(): Int {
        return R.layout.activity_oc_private_key
    }

    override fun getTitleText(): String {
        return "导出私钥"
    }

    override fun initView() {
        initToolbar(commToolBar, commTitle)
        btnPrivateKeyCopy.setOnClickListener {
            StringUtil.copy(mContext,tvPrivateKey.text.toString())
            showShortToast("已复制到剪切板")
        }
    }

    override fun initData() {
        tvPrivateKey.text = intent.getStringExtra("key")
    }

    override fun createPresenter(): BasePresenter<IBaseView>? {
        return null
    }

    override fun createView(): IBaseView? {
        return null
    }

    override fun showBindEth(): Boolean {
        return false
    }
}
